//
//  YFLlittleAlbumCollectionViewCell.m
//  Music
//
//  Created by dllo on 16/6/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YFLlittleAlbumCollectionViewCell.h"

@implementation YFLlittleAlbumCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.mainImageView =[[UIImageView alloc]init];
        self.mainImageView.backgroundColor =[UIColor whiteColor];
        
        [self.contentView addSubview:self.mainImageView];
        
        
        self.titleLabel= [[UILabel alloc]init];
        self.titleLabel.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.titleLabel];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.mainImageView.frame = CGRectMake(0, 0, (Screenwidth-45)/2, 120);
    
    self.titleLabel.frame = CGRectMake(self.mainImageView.frame.origin.x, self.mainImageView.frame.origin.y+self.mainImageView.frame.size.height, self.mainImageView.frame.size.width, 30);
}

-(void)setALBUMmodel:(YFLalbumModel *)ALBUMmodel
{
    if (_ALBUMmodel != ALBUMmodel) {
        _ALBUMmodel = ALBUMmodel;
        
        [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:_ALBUMmodel.picUrl] placeholderImage:[UIImage imageNamed:@"占.jpg"]];
        self.titleLabel.text = self.ALBUMmodel.name;
    }
    
    
}
@end
